package cate.game.role.farm.udgpalace.msg;

import cate.common.annotation.OperationSetter;
import cate.common.table.d.GDOperation;
import cate.common.util.GameResult;
import cate.game.GameBody;
import cate.game.client.ClientContext;
import cate.game.client.msg.ClientMsg;
import cate.game.client.msg.MsgConfig;
import cate.game.client.msg.MsgInput;
import cate.game.client.msg.id.MsgIdBUdgPalace;
import easy.java.dev.note.NoteField;

@ClientMsg(title = "地宫探险购买商品的请求")
@OperationSetter(value = GDOperation.UDG_PALACE_BUY_ITEM)
public class UdgPalaceBuyReq implements MsgInput {
    @NoteField("商品uid")
    public String itemUid;

    @Override
    public void execute(GameBody game, ClientContext cc) {
        GameResult<Void> r = cc.getRole().getFarm().udgPalace.buyShopItem(itemUid);
        game.notice.message(cc.getRole(), r, true);
    }

    @Override
    public MsgConfig conf() {
        return MsgIdBUdgPalace.BUY_ITEM_REQ;
    }
}
